package demoMod.invincibleOne.powers;

import com.megacrit.cardcrawl.actions.common.ReducePowerAction;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.PowerStrings;
import com.megacrit.cardcrawl.powers.AbstractPower;
import demoMod.invincibleOne.InvincibleOneMod;
import demoMod.invincibleOne.interfaces.OilApplyHook;

public class IndustrialRevolutionPower extends AbstractPower implements OilApplyHook {
    public static final String POWER_ID = InvincibleOneMod.makeID("IndustrialRevolutionPower");
    private static final PowerStrings powerStrings = CardCrawlGame.languagePack.getPowerStrings(POWER_ID);
    public static final String NAME = powerStrings.NAME;
    public static final String[] DESC = powerStrings.DESCRIPTIONS;

    public IndustrialRevolutionPower(AbstractCreature owner, int amount) {
        this.owner = owner;
        this.ID = POWER_ID;
        this.name = NAME;
        this.amount = amount;
        this.updateDescription();
        loadRegion("painfulStabs");
        this.type = PowerType.DEBUFF;
        this.isTurnBased = true;
        this.priority = 10;
    }

    @Override
    public void updateDescription() {
        this.description = String.format(DESC[0], this.amount);
    }

    @Override
    public void atStartOfTurn() {
        addToBot(new ReducePowerAction(owner, owner, this, 1));
    }

    @Override
    public int onApplyOil(AbstractCreature target, int amount) {
        return amount * 2;
    }
}
